<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'pessoa.label', default: 'Pessoa')}" />
        <title><g:message code="default.create.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="cabelistlateral"><img src="${resource(dir:'images',file:'seta_cabecalho_20x20.png')}" /> Cadastro de Usuário</div><br/>
        <div class="body">
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${pessoaInstance}">
            <div class="errors">
                <g:renderErrors bean="${pessoaInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form action="save" >
                <div class="dialog">
                    <table>
                        <tbody>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="nome"><g:message code="pessoa.nome.label" default="Nome Completo" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pessoaInstance, field: 'nome', 'errors')}">
                                    <g:textField name="nome" maxlength="100" size="50" value="${pessoaInstance?.nome}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="status"><g:message code="pessoa.status.label" default="Status" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pessoaInstance, field: 'status', 'errors')}">
                                  <select name="status" style="width:75px;">
                                      <option value="0" <%if(pessoaInstance?.status=='0'){%>selected<%}%>>Inativo</option>
                                      <option value="1" <%if(pessoaInstance?.status=='1'){%>selected<%}%>>Ativo</option>
                                  </select>
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="username"><g:message code="pessoa.username.label" default="Username" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pessoaInstance, field: 'username', 'errors')}">
                                    <g:textField name="username" maxlength="60" value="${pessoaInstance?.username}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="password"><g:message code="pessoa.password.label" default="Password" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pessoaInstance, field: 'password', 'errors')}">
                                    <g:passwordField name="password" value="${pessoaInstance?.password}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="banco"><g:message code="pessoa.banco.label" default="Banco" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pessoaInstance, field: 'banco', 'errors')}">
                                    <g:textField name="banco" value="${pessoaInstance?.banco}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="ag"><g:message code="pessoa.ag.label" default="Agência" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pessoaInstance, field: 'ag', 'errors')}">
                                    <g:textField name="ag" value="${pessoaInstance?.ag}" />
                                </td>
                            </tr>
                        
                            <tr class="prop">
                                <td valign="top" class="name">
                                    <label for="cc"><g:message code="pessoa.cc.label" default="Conta Corrente" /></label>
                                </td>
                                <td valign="top" class="value ${hasErrors(bean: pessoaInstance, field: 'cc', 'errors')}">
                                    <g:textField name="cc" value="${pessoaInstance?.cc}" />
                                </td>
                            </tr>
                            <tr>
                              <td></td>
                              <td class="btsalvarcadastro">
                                  <g:submitButton name="create" class="save ui-corner-all" value="SALVAR" />
                                  <input type="button" class="ui-corner-all" value="VOLTAR" onclick="location.href='${createLink(controller:'pessoa', action:'list')}';" />
                              </td>
                            </tr>
                        </tbody>
                    </table>
                </div>
            </g:form>
        </div>
    </body>
</html>
